#ifndef MINIMENU_H
#define MINIMENU_H

#include <QGraphicsObject>
#include "gui.h"

class KTV;
class Resource;
class QPropertyAnimation;

class MiniMenu : public GUI
{
    Q_OBJECT
    Q_PROPERTY(int index READ indexForAnimation WRITE setIndexForAnimation)
public:
    MiniMenu(KTV *k, int w, int h);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void keyPressEvent(QKeyEvent *event);

    void appear(int mode);
    void disappear();

    void nextMenu();
    void previousMenu();
    void startAnimation();

    int indexForAnimation() const { return index_for_animation; }
    void setIndexForAnimation(int index);
    // GUI assosciated
    void left() { previousMenu(); }
    void right() { nextMenu(); }
	void exchange();
    void select();
private slots:
    void afterDisappear();

public:
    static const int MODE_SINGER = 0;
    static const int MODE_SONG = 1;
    static const int MODE_SELECTED_SONG = 2;
private:
    Resource *resource;
    KTV *ktv;
    int width;
    int height;
    QPixmap *backgroundPixmap;

    int currMenu;
    QList<QPixmap *> *curr_appearance;
    QList<QPixmap *> *curr_option;

    int index_for_animation;
    QPropertyAnimation *animation;

    QList<QPixmap *> *appearance_singer;
    QList<QPixmap *> *appearance_song;
    QList<QPixmap *> *appearance_selected_song;

    QList<QPixmap *> *option_singer;
    QList<QPixmap *> *option_song;
    QList<QPixmap *> *option_selected_song;
};

#endif // MINIMENU_H
